const Router = require("koa-router");
const {
  create,
  list,
  detail,
  update,
  registerStatus,
  expertType,
} = require("../controller/user.controller");
const { verifyUser, handlePassword } = require("../middleware/user.middleware");
const { verifyAuth } = require("../middleware/auth.middleware");

const userRouter = new Router({ prefix: "/users" });
userRouter.get("/", list);
userRouter.get("/:userId", detail);
userRouter.put("/", verifyAuth, update);
userRouter.post("/", verifyUser, handlePassword, create);
userRouter.post("/registerStatus", verifyAuth, registerStatus);
userRouter.post("/expertType", verifyAuth, expertType);

module.exports = userRouter;
